#include "AuxFunctions.h"

int manageOptions(int n_options) {
	string option_str;
	cout << "Option >> ";
	cin >> option_str;
	int option = atoi(option_str.c_str());

	if (option > 0 and option <= n_options)
		return option;
	else {
		cout << "Invalid option: " << option << endl;
		return -1;
	}
}

bool isNotNumber(string _date) {
	for (size_t i = 0; i < _date.size(); i++) {
		if (!isdigit(_date[i])) {
			return true;
		}
	}

	return false;
}

string toUpper(string str) {
	size_t i; // counter
	size_t strSize = str.size(); // size of the string

	for (i = 0; i < strSize; i++) {
		char c = str[i];
		str[i] = toupper(c);
	}

	return str;
}
